test-2:在 Agent 里做目录列举、内容检索与批量文件操作
test-2 是 SkillHub 社区 Skill(@user_38fa0bef/for-test2,v1.0.1,dev-programming),无需 API Key。它面向列举目录、递归按名/内容搜索、类型过滤、目录与体积分析,以及复制/移动/删除等批处理。文章依据官方简介与 SkillHub 安装文档,说明 CLI 与对话安装方式、Cursor 等常见 skills 路径,并给出基于官方能力描述的对话式用法要点与批量操作注意事项。
Read Moretest:面向 Agent 的高级文件系统操作 Skill
test 是 SkillHub 社区 Skill(@user_38fa0bef/for-test,v1.0.1),归类 dev-programming,无需 API Key。它面向高级文件系统操作:列目录、递归与类型过滤搜索、目录与体积分析,以及复制、移动、删除等批处理。文章说明其定位与官方能力描述,并给出通过 skillhub CLI 安装到 Cursor、Claude Code、Codex 等 skills 目录的步骤与注意点,适合在对话式编码中统一文件级操作约定。
Read MoreDetailed Explanation of Node.js Core Module fs: Easily Implement File Reading and Writing
The `fs` module in Node.js is a core tool for interacting with the file system, supporting both synchronous and asynchronous APIs. Synchronous methods block code execution, while asynchronous methods are non-blocking and suitable for high concurrency; beginners are advised to prioritize learning asynchronous operations first. Basic operations include file reading and writing: for asynchronous reading, use `readFile` (requiring callbacks to handle errors and data), and for synchronous reading, use `readFileSync` (requiring `try/catch` blocks). Writing can be either overwriting (`writeFile`) or appending (`appendFile`). Directory operations include `mkdir` (supports recursive creation), `readdir` (lists directory contents), and `rmdir` (only removes empty directories). Path handling should use the `path` module. It is recommended to combine `__dirname` (the directory where the script is located) to construct absolute paths, avoiding reliance on relative paths that depend on the execution location. For large file processing, streams (Stream) should be used to read/write data in chunks and avoid excessive memory usage. Common issues: Path errors can be resolved by using absolute paths, and large files should be processed with the `pipe` stream method. Practical suggestions include starting with simple read/write and directory operations, combining them with the `path` module, and understanding the advantages of the asynchronous non-blocking model.
Read MoreMounting Linux File Systems: Essential Steps for Beginners
Mounting in Linux is a crucial operation to connect external storage devices (such as hard drives and USB flash drives) to the directory structure, enabling the system to read data from external devices as if they were local files. Since Linux directories follow a tree structure, external devices must be attached to the system's directory tree through a mount point (an empty directory). **Core Concepts**: Device name (e.g., `/dev/sdb1`) and mount point (e.g., `/mnt/usb`). Before operation, confirm the device name using `lsblk` or `fdisk -l`, and create the mount point with `sudo mkdir`. **Mounting Steps**: 1. Execute `sudo mount [device name] [mount point]`; 2. Verify success with `df -h` or `mount`; 3. Unmount using `sudo umount [mount point]`, ensuring no programs are accessing the device. **Common Issues**: Non-existent mount points, incorrect device names, and "device busy" during unmounting. Solutions include creating the directory, confirming the device, and exiting programs using the device. Temporary mounts are not persistent across reboots; permanent mounts require modifying `/etc/fstab`. **Summary**: By mastering device names, mount points, and the `mount/umount` commands, combined with `lsblk` to verify devices, you can successfully mount and access external storage.
Read More